import React, { useState } from "react";
import "./Pj.css";
import { Button, Input } from "antd-mobile";
import Chat from "../../component/chat";
import Chatt from '../../component/chatt'
const Index = () => {
  const [value, setValue] = useState("");
  const [list, setlist] = useState([]);
  const send = () => {
    setlist((prve) => [...prve, { message: value }]);
  };
  return (
    <div>
      <div className="box">
        <p>
          {list.map((item, index) => (
            <Chatt key={index} {...item} />
          ))}
        </p>
      </div>
      <div className="bottom">
        <Input
          placeholder="请输入内容"
          value={value}
          onChange={(val) => {
            setValue(val);
          }}
        />
        <Button color="success" onClick={() => send()}>
          去评价
        </Button>
      </div>
    </div>
  );
};

export default Index;
